package com.youle.robots;

import org.springframework.context.ApplicationListener;
import org.springframework.integration.mqtt.event.MqttSubscribedEvent;

/**
 * Created by IntelliJ IDEA.
 * 订阅触发器
 * User: kedong
 * Date: 18-3-22
 * Time: 下午3:44
 * To change this template use File | Settings | File and Code Templates ->Includes->File Header.
 */
public class MqttSubscribedListener implements ApplicationListener<MqttSubscribedEvent> {

    /**
     * 当成功订阅主题后会出发订阅成功事件，这里会收到通知
     *
     * @param event
     */
    @Override
    public void onApplicationEvent(MqttSubscribedEvent event) {
        System.out.println("订阅客户端");
        System.out.println(event.getMessage());
    }
}
